From 57401e602c19317e8e031d083020b58b73d15625 Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Sun, 18 Jan 2009 13:33:52 +0000 Subject: [PATCH] New file collecting the type constants, includes and the union for the * babl/babl-classes.h: New file collecting the type constants, includes and the union for the babl classes. When adding a new class this is the only installed header file that requires modification. * babl/babl-class.h: Move the class type enums to the new file. * babl/babl.h: Include babl-classes.h instead of each class on its own, and move the Babl union to the new file. * babl/Makefile.am: Add the new file. svn path=/trunk/; revision=385 --- ChangeLog | 14 +++++++ babl/Makefile.am | 2 + babl/babl-class.h | 32 --------------- babl/babl-classes.h | 94 +++++++++++++++++++++++++++++++++++++++++++++ babl/babl.h | 31 +-------------- 5 files changed, 112 insertions(+), 61 deletions(-) create mode 100644 babl/babl-classes.h diff --git a/ChangeLog b/ChangeLog index 320da45..fd88020 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2009-01-18 Martin Nordholts + + * babl/babl-classes.h: New file collecting the type constants, + includes and the union for the babl classes. When adding a new + class this is the only installed header file that requires + modification. + + * babl/babl-class.h: Move the class type enums to the new file. + + * babl/babl.h: Include babl-classes.h instead of each class on its + own, and move the Babl union to the new file. + + * babl/Makefile.am: Add the new file. + 2009-01-18 Sven Neumann * babl/babl-component.h diff --git a/babl/Makefile.am b/babl/Makefile.am index 40479df..039e756 100644 --- a/babl/Makefile.am +++ b/babl/Makefile.am @@ -35,6 +35,7 @@ c_sources = \ h_sources = \ babl-class.h \ + babl-classes.h \ babl-db.h \ babl-ids.h \ babl-internal.h \ @@ -52,6 +53,7 @@ library_includedir=$(includedir)/babl-$(BABL_API_VERSION)/babl library_include_HEADERS = \ babl.h \ babl-class.h \ + babl-classes.h \ babl-component.h \ babl-conversion.h \ babl-extension.h \ diff --git a/babl/babl-class.h b/babl/babl-class.h index 65a0a35..811dff7 100644 --- a/babl/babl-class.h +++ b/babl/babl-class.h @@ -23,38 +23,6 @@ #error this file is only to be included by babl.h #endif - -/* magic number used at the start of all babl objects, used to do - * differentiation in polymorphic functions. (as well as manual - * type check assertions). - */ -#define BABL_MAGIC 0xbab100 - -enum { - BABL_INSTANCE = BABL_MAGIC, - BABL_TYPE, - BABL_TYPE_INTEGER, - BABL_TYPE_FLOAT, - BABL_SAMPLING, - BABL_COMPONENT, - BABL_MODEL, - BABL_FORMAT, - - BABL_CONVERSION, - BABL_CONVERSION_LINEAR, - BABL_CONVERSION_PLANE, - BABL_CONVERSION_PLANAR, - - BABL_FISH, - BABL_FISH_REFERENCE, - BABL_FISH_SIMPLE, - BABL_FISH_PATH, - BABL_IMAGE, - - BABL_EXTENSION, - - BABL_SKY -}; typedef int BablClassType; typedef union _Babl Babl; diff --git a/babl/babl-classes.h b/babl/babl-classes.h new file mode 100644 index 0000000..84b694c --- /dev/null +++ b/babl/babl-classes.h @@ -0,0 +1,94 @@ +/* babl - dynamically extendable universal pixel conversion library. + * Copyright (C) 2005-2008, Øyvind Kolås and others. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, see + * . + */ + +#ifndef _BABL_CLASSES_H +#define _BABL_CLASSES_H + +#ifndef _BABL_H +#error this file is only to be included by babl.h +#endif + + +/* magic number used at the start of all babl objects, used to do + * differentiation in polymorphic functions. (as well as manual type + * check assertions). + */ +#define BABL_MAGIC 0xbab100 + +/* class types */ +enum { + BABL_INSTANCE = BABL_MAGIC, + BABL_TYPE, + BABL_TYPE_INTEGER, + BABL_TYPE_FLOAT, + BABL_SAMPLING, + BABL_COMPONENT, + BABL_MODEL, + BABL_FORMAT, + + BABL_CONVERSION, + BABL_CONVERSION_LINEAR, + BABL_CONVERSION_PLANE, + BABL_CONVERSION_PLANAR, + + BABL_FISH, + BABL_FISH_REFERENCE, + BABL_FISH_SIMPLE, + BABL_FISH_PATH, + BABL_IMAGE, + + BABL_EXTENSION, + + BABL_SKY +}; + + +#include "babl-type.h" +#include "babl-sampling.h" +#include "babl-component.h" +#include "babl-model.h" +#include "babl-format.h" +#include "babl-image.h" +#include "babl-conversion.h" +#include "babl-fish.h" +#include "babl-extension.h" + + +/* This union can be used for convenient access to any field without + * the need to case if the variable already is of the type Babl* + */ +typedef union _Babl +{ + BablClassType class_type; + BablInstance instance; + BablType type; + BablSampling sampling; + BablComponent component; + BablModel model; + BablFormat format; + BablConversion conversion; + BablImage image; + BablFish fish; + BablFishReference fish_reference; + BablFishSimple fish_simple; + BablFishPath fish_path; + BablExtension extension; +} _Babl; + + +#endif diff --git a/babl/babl.h b/babl/babl.h index 17fa219..f953c1c 100644 --- a/babl/babl.h +++ b/babl/babl.h @@ -28,6 +28,7 @@ #error babl.h included after babl-internal.h #endif + typedef struct _BablList BablList; #include "babl-macros.h" @@ -35,35 +36,7 @@ typedef struct _BablList BablList; #include "babl-class.h" #include "babl-introspect.h" #include "babl-version.h" -#include "babl-type.h" -#include "babl-sampling.h" -#include "babl-component.h" -#include "babl-model.h" -#include "babl-format.h" -#include "babl-image.h" -#include "babl-conversion.h" -#include "babl-fish.h" -#include "babl-extension.h" +#include "babl-classes.h" -/* This union can be used for convenient access to any field without the need - * to case if the variable already is of the type Babl * - */ -typedef union _Babl -{ - BablClassType class_type; - BablInstance instance; - BablType type; - BablSampling sampling; - BablComponent component; - BablModel model; - BablFormat format; - BablConversion conversion; - BablImage image; - BablFish fish; - BablFishReference fish_reference; - BablFishSimple fish_simple; - BablFishPath fish_path; - BablExtension extension; -} _Babl; #endif -- 2.30.2